﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Default.master" CodeFile="Tables.aspx.cs" Inherits="Tables" Title="<%$Resources:web.sitemap, Tables.Title %>"%>
<%@ Register TagPrefix="Location" TagName="Database" Src="~/Toolbars/DatabaseLocation.ascx" %>
<%@ Register TagPrefix="Location" TagName="Server" Src="~/Toolbars/ServerLocation.ascx" %>
<%@ Register TagPrefix="Toolbar" TagName="HelpLogout" Src="~/Toolbars/HelpLogoutToolbar.ascx" %>
<asp:Content runat="server" ContentPlaceHolderID="breadcrumb">
	<Location:Server Runat="Server" id="ServerLocation"></Location:Server>
	<Location:Database Runat="Server" id="DatabaseLocation" IsActive="true"></Location:Database>
</asp:Content>
<asp:Content runat="server" ContentPlaceHolderID="NavigationPane">
</asp:Content>
<asp:Content runat="server" ContentPlaceHolderID="ContentPane">
    <div class="RightCenterWell">
        <table width="100%">
            <tr>
                <td valign="top">
                    <asp:Image ID="icon_tables_32" SkinID="icon_tables_32" runat="Server" />
                </td>
                <td>
                    <span class="header3"><%= Request.QueryString["database"] %>: <asp:Literal ID="Literal1" runat=Server text="<%$Resources:LocalizedText,Tables_Header %>" /></span>
                    <hr />
                    <p>
                      <asp:Literal runat=Server text="<%$Resources:LocalizedText,Tables_Instruction %>" /></p>
                    <br />
                    <br />
                    <hr />
                 
                   <asp:Literal ID="Literal2" runat=Server text="<%$Resources:LocalizedText,Tables_Filter %>" /><br />
                    <asp:DropDownList width="200" AutoPostBack="true" OnSelectedIndexChanged="ddlFilter_SelectedIndexChanged" ID="ddlFilter" runat="Server">
                        <asp:ListItem id="liShowUser" Selected="true" text="<%$Resources:LocalizedText,Tables_FilterOptionUser %>"> </asp:ListItem>
                        <asp:ListItem id="liShowSystem" text="<%$Resources:LocalizedText,Tables_FilterOptionSystem %>"> </asp:ListItem>
                    </asp:DropDownList>
                    <asp:Label ID="Label1" Runat="server" ForeColor="red" Visible="False"></asp:Label>
                    </p>
                    <div class="TableGrid">
						<asp:datagrid id="dgTables" runat="server" GridLines="None" Border="0" AutoGenerateColumns="False" Width="97.4%" CellPadding="4" CellSpacing="1" OnSelectedIndexChanged="dgTables_SelectedIndexChanged">
							<Columns>
								<asp:TemplateColumn HeaderText="<%$Resources:LocalizedText,Tables_Name %>"><ItemTemplate>
										<asp:HyperLink id="Hyperlink1" runat="server" text='<%# "&amp;nbsp;" + DataBinder.Eval(Container.DataItem, "Name") %>' cssclass="databaseListBlack" NavigateUrl='<%# String.Format("TableProperties.aspx?database={0}&table={1}&schema={2}", Server.UrlEncode(Request.QueryString["database"]), DataBinder.Eval(Container.DataItem, "Name"), DataBinder.Eval(Container.DataItem, "Schema")) %>'></asp:HyperLink>
									</ItemTemplate>
									<HeaderStyle Wrap="False"></HeaderStyle>
									<ItemStyle Wrap="False"></ItemStyle>
								</asp:TemplateColumn>
								<asp:BoundColumn DataField="Schema" HeaderText="<%$Resources:LocalizedText,Tables_Owner %>" DataFormatString="{0}">
									<HeaderStyle Wrap="False"></HeaderStyle>
									<ItemStyle HorizontalAlign="center" Wrap="False"></ItemStyle>
								</asp:BoundColumn>
 
								<asp:BoundColumn DataField="CreateDate" HeaderText="<%$Resources:LocalizedText,Tables_CreateDate %>" DataFormatString="{0}">
									<HeaderStyle Wrap="False"></HeaderStyle>
									<ItemStyle HorizontalAlign="center" Wrap="False"></ItemStyle>
								</asp:BoundColumn>
								<asp:BoundColumn DataField="RowCount" HeaderText="<%$Resources:LocalizedText,Tables_Rows %>" DataFormatString="{0}">
									<HeaderStyle Wrap="False"></HeaderStyle>
									<ItemStyle HorizontalAlign="center" Wrap="False"></ItemStyle>
								</asp:BoundColumn>
								<asp:TemplateColumn HeaderText="Actions">
								    <ItemTemplate>
										<asp:HyperLink id="RenameHyperLink" runat="server" text="<%$Resources:LocalizedText,Tables_Open %>" cssclass="databaseListAction" NavigateUrl='<%# String.Format("DataEntry.aspx?database={0}&table={1}&schema={2}", Server.UrlEncode(Request.QueryString["database"]), DataBinder.Eval(Container.DataItem, "Name"), DataBinder.Eval(Container.DataItem, "Schema")) %>'></asp:HyperLink>
									</ItemTemplate>
									<HeaderStyle Wrap="False" HorizontalAlign="Right"></HeaderStyle>
									<ItemStyle HorizontalAlign="center" Wrap="False" ></ItemStyle>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="Rename">
								    <ItemTemplate>
										<asp:HyperLink id="RenameHyperLink" runat="server" text="<%$Resources:LocalizedText,Tables_Rename %>" cssclass="databaseListAction" NavigateUrl='<%# String.Format("RenameTable.aspx?database={0}&table={1}&schema={2}", Server.UrlEncode(Request.QueryString["database"]), DataBinder.Eval(Container.DataItem, "Name"), DataBinder.Eval(Container.DataItem, "Schema")) %>'></asp:HyperLink>
									</ItemTemplate>
									<HeaderStyle Wrap="False" HorizontalAlign="Right"></HeaderStyle>
									<ItemStyle HorizontalAlign="center" Wrap="False" ></ItemStyle>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="Delete"><ItemTemplate>
										<asp:HyperLink id="DeleteTable" runat="server" text="<%$Resources:LocalizedText,Tables_Delete %>" cssclass="databaseListAction" NavigateUrl='<%# String.Format("DeleteTable.aspx?database={0}&table={1}&schema={2}", Server.UrlEncode(Request.QueryString["database"]), DataBinder.Eval(Container.DataItem, "Name"), DataBinder.Eval(Container.DataItem, "Schema")) %>'></asp:HyperLink>
									</ItemTemplate>
									<HeaderStyle Wrap="False" HorizontalAlign="Right"></HeaderStyle>
									<ItemStyle HorizontalAlign="center" Wrap="False"></ItemStyle>
								</asp:TemplateColumn>
							</Columns>
							<ItemStyle CssClass="TableItem"></ItemStyle>
							<AlternatingItemStyle CssClass="AlternateTableItem" />
							<HeaderStyle CssClass="TableHeader"></HeaderStyle>
						</asp:datagrid>
						<asp:label id="lblError" runat="server" EnableViewState="False" Font-Bold="true" Font-Size="10" Visible="False" Text="<%$Resources:LocalizedText,Tables_ErrorNoTables %>"></asp:label>
                    </div>
                    <br />
                    <table width="100%" cellspacing="0" cellpadding="0" border="0">
                        <tr>
                            <td align="left">
						        <asp:Button ID="btnAddNewTable" Text="<%$Resources:LocalizedText,Tables_NewTable %>" OnClick="btnAddNewTable_Click" runat="Server" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    
</asp:Content>

